﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace Webcam_Filter
{
    class Ants : Filter
    {
        protected override void runfilter(byte[] rgbValues, int hoogte, int breedte, string[] args)
        {

            int B, G, R;
            int breedteARGB = breedte * 4;

            for (int i = 0; i < breedteARGB * hoogte; i += 4)
            {
                B = rgbValues[i];
                G = rgbValues[i + 1];
                R = rgbValues[i + 2];
                if (G <= 250 && G >= 150 && R >= 200 && R <= 255 && B >= 85 && B <= 175)
                {
                    rgbValues[i] = 0;
                    rgbValues[i + 1] = 0;
                    rgbValues[i + 2] = 0;
                }

                if (G <= 255 && G >= 165 && R <= 255 && R >= 165 && B >= 165 && B <= 255)
                {
                    rgbValues[i] = 0;
                    rgbValues[i + 1] = 0;
                    rgbValues[i + 2] = 0;
                }
                if (G <= 220 && G >= 209 && R <= 255 && R >= 240 && B >= 192 && B <= 203)
                {
                    rgbValues[i] = 0;
                    rgbValues[i + 1] = 0;
                    rgbValues[i + 2] = 0;
                }
                if (G <= 106 && G >= 99 && R <= 180 && R >= 175 && B >= 40 && B <= 70)
                {
                    rgbValues[i] = 0;
                    rgbValues[i + 1] = 0;
                    rgbValues[i + 2] = 0;
                }


            }
        }
    }
}
